# @time     :2022/1/17
# @Author   :Simple
# @FileName :app
from appium import webdriver

from util.base_common import read_yaml
from xueqiu_demo.page.base_page import BasePage as base
from xueqiu_demo.page.main_page import MainPage as main_page

# config = read_yaml('/../xueqiu_demo/datas/caps.yml')
# desired_caps = config['desired_caps']
# server = config['server']


class App(base):
    # def start(self):
    #     if self.driver is None:
    #         # 启动app，客户端与服务端建立连接
    #         self.driver = webdriver.Remote(f"{server['ip']}:{server['port']}/wd/hub", desired_caps)
    #         self.driver.implicitly_wait(5)
    #     else:
    #         self.driver.launch_app()
    #     return self
    #
    # def restart(self):
    #     # 重启app
    #     self.driver.close_app()
    #     self.driver.launch_app()
    #
    # def stop(self):
    #     self.driver.quit()

    def goto_main(self):
        return main_page(self.driver)

